package com.intellagric.controller.module.recommend;


import com.intellagric.agriecom.module.recommend.RecommendServiceIN;
import com.intellagric.pojo.AgriecomProduce;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Auther: zhy
 * @Date: 2019/5/8
 * @Description: 商品推荐
 */
@Controller
public class RecommendController {

    @Autowired
    private RecommendServiceIN recommendService;

    /**
     * 根据推荐栏位来进行商品的推荐
     *
     * @param columnId  栏位id
     * @param userId    用户id
     * @return ResponseMessage
     */
    @RequestMapping("/recommend")
    @ResponseBody
    public List<AgriecomProduce> recommendByCulumnId(int columnId, String userId) {
        List<AgriecomProduce> recomendProductList = recommendService.recomend(columnId, userId);
        return recomendProductList;
//        return ResponseMessage.success().add("recomendProductList",recomendProductList);
    }





}
